
using Microsoft.EntityFrameworkCore;
using ShoppingCenter.Backend.Api.Model;

namespace ShoppingCenter.Backend.Api.Db
{
    public class ShoppingCenterDb : DbContext
    {
        public ShoppingCenterDb() { }
        public ShoppingCenterDb(DbContextOptions options) : base(options) { }


        //管理员
        public DbSet<Admin> Admins { get; set; }

        //属性 
        public DbSet<Attribute> Attribute { get; set; }

        //轮播图
        public DbSet<Broadcast_map> Broadcast_map { get; set; }

        // 属性值
        public DbSet<Attribute_value> AttributeValue { get; set; }

        // 评价
        public DbSet<Comment> Comments { get; set; }

        //商品类别
        public DbSet<Commodity_category> commodityCategory { get; set; }

        //商品详情
        public DbSet<Details> Details { get; set; }

        //商场简介         
        public DbSet<MallMsg> MallMsg { get; set; }

        //商品
        public DbSet<Merchandise> Merchandise { get; set; }

        //商家（店铺）
        public DbSet<Merchant> Merchant { get; set; }

        // 订单
        public DbSet<Order> Orders { get; set; }

        //好评表
        public DbSet<Praise> Praises { get; set; }

        // 收货信息
        public DbSet<Receiving_information> receivingInformation { get; set; }

        //购物车
        public DbSet<Shopping_Cart> shoppingCarts { get; set; }

        //规格
        public DbSet<Specifications> Specifications { get; set; }

        // 供应商
        public DbSet<Supplier> Supplier { get; set; }
       
       
        public DbSet<User> Users { get; set; }
        public DbSet<UserMsg> UserMsgs { get; set; }

        public DbSet<Pay> Pay { get; set; }


        //添加种子数据, 数据库 
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Seed();
        }

        protected override void OnConfiguring(DbContextOptionsBuilder builder)
        {
            builder.UseSqlServer(@"server=.;database=ShoppingCenter;uid=sa;pwd=123");
        }
    }
}